Reserved keywords

Python have few reserved keywords, which cannot be used as variable names and have specific function or meaing. What that means is that one cannot use a reserved keywords as variable name as shown below.


In [6]:
is = 10


  File "<ipython-input-6-cc34fec5d1d4>", line 1
    is = 10
     ^
SyntaxError: invalid syntax

NOTE: Trying to use one will always result in SyntaxError as shown above.

List of reserved keywords is as follows. We will be covering most of them in later sections

and as assert break class
continue def del elif else
except False finally for from
global if import in is
lambda None nonlocal not or
pass raise return True try
while with yield